<template>
	<view class="">
		<view class="pt100" v-if="!list.length">
			<u-empty mode="order" />
		</view>
		<view v-for="(item,index) in list" :key="index" @click.stop="jump(item)"
			class="box-shadow mt20 pl20 pr18 pt26 radius20 bg-fff pb24 my_box_shadow">
			<view v-if="item.order_sn" class="radius20 h76 pl18 pr18 bg-f7f mb20 flex">
				<view class="color-999">订单号：</view>
				<view class="flex1">{{item.order_sn}}</view>
				<view class="color-zs fs26">{{item.status_text||item.status}}</view>
			</view>
			<view class="flex row-between pb24 border-b pb20">
				<view class="color-232323 fs30 fw-600">{{item.service_name}}</view>
				<view class="color-666 fs28">{{item.hospital||item.hospital_name}}</view>
			</view>
			<view class="mt18 flex ">
				<view class="fs30 color-232323">{{item.patient_name}}</view>
				<view class="bg-FF704B-7 flex radius22 ml12 pr14">
					<image src="/static/img/index/girl.png" v-if="item.sex==2" class="h44 w44" mode=""></image>
					<image src="/static/img/index/boy.png" v-else-if="item.sex==1" class="h44 w44  " mode=""></image>
					<view class="color-FF704B fs20  ">{{item.age}}岁</view>
				</view>
			</view>
			<view class="color-9A9696 mt14 fs28">{{item.mobile}}</view>
			<view class="flex row-between  flex fs26">
				<view class="color-999 flex1">期望就诊时间：{{item.expect_time}}</view>
				<view >
					<view v-if="item.status==8" class="bg-zs radius12 color-fff h64 pr28 pl28 flex">审核</view>
					<view v-if="item.status==2" class="bg-zs radius12 color-fff h64 pr28 pl28 flex ">立即签到</view>
					<view v-if="item.status==7" class="bg-zs radius12 color-fff h64 pr28 pl28 flex "
						@click.stop="$jump('/pages/order/evaluate',{order_id: item.order_id || item.id || ''})">查看评价
					</view>
					<view v-if="item.status==4" class="bg-zs radius12 color-fff h64 pr28 pl28 flex ">提交核销</view>
					<!-- <view v-if="item.status==3" class="pr28 pl28 h64 radius12 color-999 flex row-cente"
						style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">删除订单</view> -->
				</view>

				<!-- type：0=立即报价，1=抢单，2接单，3=已被抢走，4=已抢单，5已接单 -->
				<view >
					<view v-if="item.type==0" class="bg-zs radius12 color-fff h64 pr28 pl28 flex">立即报价</view>
					<view v-if="item.type==1" class="w176 h64 radius12 color-fs flex row-center"
						style="background: rgba(253,72,52,0.07);color: #FD4834;border: 1px solid rgba(253,72,52,0.45);">
						抢单￥{{item.pay_price}}
					</view>
					<view v-if="item.type==2" class="w176 h64 radius12 color-fs flex row-center"
						style="background: rgba(253,72,52,0.07);color: #FD4834;border: 1px solid rgba(253,72,52,0.45);">
						接单￥{{item.pay_price}}
					</view>
					<view v-if="item.type==3" class="w176 h64 radius12 color-999 flex row-center"
						style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
						已被抢走
					</view>
					<view v-if="item.type==4" class="w176 h64 radius12 color-999 flex row-center"
						style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
						已抢单
					</view>
					<view v-if="item.type==5" class="w176 h64 radius12 color-999 flex row-center"
						style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
						已接单
					</view>
				</view>
			</view>
			<view class="flex row-between pt20" v-if="myBaojia">
				<view class="">
					<text>我的报价:</text>
					<text class="color-fs">200元</text>
				</view>
				<view v-if="index==0" @click.stop="$jump('/pages/index/baijia/hireD')"
					class="pl12 pr12 h64 radius12 color-999 flex row-center"
					style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
					查看详情
				</view>
				<view v-else-if="index==1" class="pl12 pr12 h64 radius12 color-999 flex row-center"
					style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
					订单报价已结束
				</view>
				<view v-else class="pl12 pr12 h64 radius12 color-999 flex row-center"
					style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
					很遗憾，订单已雇佣其他师傅
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "orderInfo",
		props: {
			list: {
				default: ''
			},

			order: {
				default: false
			},

			myBaojia: {
				default: false
			},
		},
		data() {
			return {

			};
		},
		methods: {
			jump(item) {
				let params = {
					order_id: item.order_id || item.id || '',
					cancel_id:item.cancel_id||''
				}
				if (!params.order_id) return
				this.$jump('/pages/order/orderD', params)
			}
		}
	}
</script>

<style lang="scss">
	.my_box_shadow {
		box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.07);
	}
</style>
